<template>
    <div class="background">
        <title-a>
            乐村淘
        </title-a>

        <div class="swiperbox">
            <swiper>
                <div class="swiper-slide">
                    <img src="/libs/imgs/dians-banner.jpg" alt="" class="banner">
                </div>
            </swiper>
        </div>
        <ul class="imgs">
            <li>
                <a href="http://v.youku.com/v_show/id_XMjk0Njk3MDY3Ng==.html?spm=a2h3j.8428770.3416059.1"><img src="/libs/imgs/imgs-1.jpg" alt=""></a>
            </li>
            <li><img src="/libs/imgs/imgs-2.jpg" alt=""></li>
        </ul>
        <div class="bac">
            <img src="/libs/imgs/fp_bg06.jpg" alt="">
        </div>

        <div class="pics">
            <ul>
                <li v-for="item in pics" :key="item.goods_id">
                    <div class="img">
                        <img :src="`//img.lecuntao.com/data/upload/shop/store/goods/${item.store_id}/` + item.goods_image" alt="">
                        <p class="words">{{item.goods_name}}</p>
                        <p class="price">￥ {{item.goods_price}}</p>
                    </div>
                </li>
            </ul>
        </div>

        <div class="bac">
            <img src="/libs/imgs/fp_bg07.jpg" alt="">
        </div>
        <div class="pics2">
            <ul>
                <li v-for="item in pics2" :key="item.goods_id">
                    <div class="img">
                        <img :src="`//img.lecuntao.com/data/upload/shop/store/goods/${item.store_id}/` + item.goods_image" alt="">
                        <p class="words">{{item.goods_name}}</p>
                        <p class="price">￥ {{item.goods_price}}</p>
                    </div>
                </li>
            </ul>
        </div>
        <div class="Carousel">
            <div class="fp_bg08"></div>
            <div class="fp_bg09"></div>
            <div class="fp_bg10">
                <swiper>
                    <div class="swiper-slide" v-for="(item,index) in honour" :key="index">
                        <div class="list">
                            <div class="header">
                                <div class="header-le">
                                    <b>{{item.time1}}</b>
                                    <span>{{item.time2}}</span>
                                </div>
                                <div class="header-ri">
                                    <b>{{item.time3}}</b>
                                    <span>{{item.time4}}</span>
                                </div>
                            </div>
                            <div class="ban">
                                <img :src="item.path" alt="">
                            </div>
                            <div class="bottom">
                                <div class="font">
                                    {{item.title}}
                                </div>
                                <div class="cont">
                                    {{item.cont}}
                                </div>
                            </div>

                        </div>
                    </div>
                </swiper>
            </div>
        </div>

        <div class="bac">
            <img src="/libs/imgs/fp_bg11.jpg" alt="">
        </div>
        <div class="pics2">
            <ul>
                <li v-for="item in pics3" :key="item.goods_id">
                    <div class="img">
                        <img :src="`//img.lecuntao.com/data/upload/shop/store/goods/${item.store_id}/` + item.goods_image" alt="">
                        <p class="words">{{item.goods_name}}</p>
                        <p class="price">￥ {{item.goods_price}}</p>
                    </div>
                </li>
            </ul>
        </div>

    </div>
</template>
<script>
import Vue from 'vue'
import axios from 'axios'
import { mapMutations } from 'vuex'
export default {
  data () {
    return {
      pics: [],
      pics2: [],
      pics3: [],
      honour: [
        {
          time1: '十月',
          time2: '2015',
          time3: '一月',
          time4: '2016',
          path: '/libs/imgs/fp_p1.jpg',
          title: '原平酥梨成功售出千吨 销售额高达635万元',
          cont: '第一届原平酥梨节为标杆，原平、祁县、平遥人民政府联合当地乐村淘进行“山西品牌网上行”活动，举办“第二届乐村淘酥梨节”，酥梨销量成功突破600万元！'
        },
        {
          time1: '一月',
          time2: '2016',
          time3: '三月',
          time4: '2016',
          path: '/libs/imgs/fp_p2.jpg',
          title: '乐村淘总部举办“永和县委县政府带领农村工作队进城卖枣推荐活动” ',
          cont: '2016年1月13日，乐村淘总部与永和县委县政府举行了战略合作签约仪式，通过乐村淘永和特色馆帮助销售永和红枣，推广永和县域公共品牌“喜和合”，帮助枣农增收脱贫，切实推进精准扶贫。'
        }
      ]
    }
  },
  mounted () {
    axios.get('/mobile/index.php?act=index&op=special&special_id=259').then(res => {
      // console.log(res.data.datas.ntj_list);
      const list = res.data.datas.ntj_list
      this.pics = list.slice(0, 5)
      this.pics2 = list.slice(5, 23)
      this.pics3 = list.slice(23)
      console.log(this.pics)
    })

    this.isshow()
  },
  methods: {
    ...mapMutations(['isshow', 'ishide'])
  },
  destroyed () {
    this.ishide()
  }
}
</script>
<style lang="scss" scoped>
.Carousel{
    width: 100%;
    .fp_bg08{
        height: 72px;
        background: url('/libs/imgs/fp_bg08.jpg') no-repeat center;
        background-size: cover;
    }
    .fp_bg09{
        height: 69px;
        background: url('/libs/imgs/fp_bg09.jpg') no-repeat center;
        background-size: cover;
    }
    .fp_bg10{
        height: 230px;
        background: url('/libs/imgs/fp_bg10.jpg') no-repeat center;
        background-size: cover;
        .swiper-slide{
            background: none;
            background: none;
            padding-left: 40px;
            padding-right: 40px;
            box-sizing: border-box;
            height: 214px;
        };
        .list{
            height: 214px;
            width: 100%;
            display: flex;
            justify-content: space-between;
            position: relative;
            .header{
                width: 100%;
                display: flex;
                justify-content: space-between;
                align-items: flex-start;
                .header-le{
                    width: 45px;
                    height: 45px;
                    background: orange;
                    b{
                        color: #fff;
                    }
                    span{
                        font-size: 15px;
                        color: #fff;
                    }
                }
                .header-ri{
                    width: 45px;
                    height: 45px;
                    background: orange;
                    b{
                        color: #fff;
                    }
                    span{
                        font-size: 15px;
                        color: #fff;
                    }
                }
            }
        }
        .ban{
            width: 145px;
            height: 88px;
            background: red;
            position: absolute;
            left: 50%;
            top: 30%;
            transform: translate(-50%,-50%);
            img{
                width: 100%;
                height: 100%;
            }
        }
        .bottom{
            position: absolute;
            left: 50%;
            top: 70%;
            transform: translate(-50%,-50%);
            width: 100%;
            padding-left: 15px;
            padding-right: 15px;
        };
        .font{
            margin-top: 5px;
            font-size: 14px;
            color: #fff;
            font-weight: 700;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
            display: -webkit-box;
        }
        .cont{
            margin-top: 10px;
            font-size: 8px;
            color: #fff;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
            display: -webkit-box;
        }
    }
}
.background{
    background: #fcf5ed;
}
.swiperbox{
    height: 200px;
    margin-top: 50px;
    margin-bottom: 20px;
    .banner{
        width: 100%;
        height: 100%;
    }
}
.imgs{
    width: 100%;
    li{
        img{
            width: 100%;
        }
    }
}
.bac{
    width: 100%;
    img{
        width: 100%;
    }
}

    .pics{
        height:165px;
        width:100%;
        ul{
            background: #fcf5ed;
            display:flex;
            width:100%;
            height:100%;
            overflow: scroll;
            // background: #fff;
            li{
                // background: #fcf5ed;
                margin-right: 10px;
                padding:10px;
                height:100%;
                // width:135px;
                font-size:12px;
                width: 33%;
                flex-shrink: 0;
                padding: 5px;
                box-sizing: border-box;
                .img{
                    width: 100%;
                    height: 100px;
                    img{
                        width: 100%;
                        height: 100%;
                    }
                    .words{
                        font-size: 13px;
                        line-height: 18px;
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        display: -webkit-box;
                    }
                    .price{
                        text-align: center;
                        color: red;
                    }
                }
            }
        }
    }
    .pics2{
        width: 100%;
        ul{
            width: 100%;
            display: flex;
            justify-content: space-between;
            flex-wrap: wrap;
            li{
                width: 49%;
                height: 240px;
                padding:10px;
                box-sizing: border-box;
                margin-bottom: 10px;
                .img{
                    width: 100%;
                    height: 100%;
                    img{
                        width: 100%;
                    }
                    .words{
                        color: #111111;
                        font-family: "微软雅黑";
                        -webkit-line-clamp: 2;
                        -webkit-box-orient: vertical;
                        overflow: hidden;
                        display: -webkit-box;
                        font-size: 15px;
                    }
                    .price{
                        font-size: 15px;
                        margin-top: 5px;
                        color: rgb(230, 170, 59);
                    }
                }
            }
        }
    }
</style>
